//
//  ActionViewController.m
//  DYPrintDemo
//
//  Created by mr.ye on 2023/11/20.
//

#import "ActionViewController.h"
#import <DYPrintSDK/DYPrintSDK.h>
#import "DYPrintItem.h"
@interface ActionViewController ()

@end

@implementation ActionViewController

- (void)viewDidLoad {
    [super viewDidLoad];
    // Do any additional setup after loading the view from its nib.
    
    
 
}
- (IBAction)setZhediePaper:(id)sender {
    [[DYBLEManager sharedInstance].print setPaperType:^(id  _Nullable obj, NSUInteger code) {
            
        NSLog(@"纸张设置完毕");
        
    } paper:(DYPrintPaperTypeFolded)];
}

- (IBAction)zhedie:(id)sender {
    


    DYPrintItem * item =[[DYPrintItem alloc]init];
    NSData * data = [item heiBiaoZhi:[UIImage imageNamed:@"img_2zheDie"]];
    [[DYBLEManager sharedInstance].print sendPrintDataCompelete:^(id  _Nonnull obj, NSUInteger code) {
            
        NSLog(@"打印回调----%@",obj);
    } data:data];
    

}



- (IBAction)checkState:(id)sender {
    
//    [[DYBLEManager sharedInstance].print setPaperBack:^(id  _Nullable obj, NSUInteger code) {
//
//        NSLog(@"回退结束");
//    }];

    [[DYBLEManager sharedInstance].print enterPaper:^(id  _Nullable obj, NSUInteger code) {

        NSLog(@"进纸结束");
    }];
//
    
    
    return;

    [[DYBLEManager sharedInstance].print checkPrintStates:^(LuckBLEManagerStatus state) {
        
        NSLog(@"=====%ld",state);

    }];
}
- (IBAction)print:(id)sender {
    DYPrintItem * item =[[DYPrintItem alloc]init];
    NSData * data = [item juanZhi:[UIImage imageNamed:@"zhongxiang"]];

    [[DYBLEManager sharedInstance].print sendPrintDataCompelete:^(id  _Nonnull obj, NSUInteger code) {
            
        NSLog(@"打印回调----%@",obj);
    } data:data];
    
}
- (IBAction)infos:(id)sender {
    
    
    DYPrintItem * item =[[DYPrintItem alloc]init];
    [item getAllInfos:^(id  _Nullable obj, NSUInteger code) {
        NSLog(@"=信息===%@",obj);
    }];

    
}
- (IBAction)set:(id)sender {
//设置关机时间
    [[DYBLEManager sharedInstance].print setShutTime:^(id  _Nonnull obj, NSUInteger code) {
        NSLog(@"设置完毕");
    } time:60];
    
    
//    [[DYBLEManager sharedInstance].print setPrintColor:^(id  _Nonnull obj, NSUInteger code) {
//        NSLog(@"设置浓度完毕");
//    } color:2];
    
    
    
    
    
}




/*
#pragma mark - Navigation

// In a storyboard-based application, you will often want to do a little preparation before navigation
- (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender {
    // Get the new view controller using [segue destinationViewController].
    // Pass the selected object to the new view controller.
}
*/

@end
